<%@ page import="java.util.*" %>



<jsp:useBean id="customer" class="se2.Customer" scope="request"/>
<jsp:setProperty name="customer" property="*"/>

	
<% 
		int id = Integer.valueOf(request.getParameter("id"));
		String name = request.getParameter("n");
		String email = request.getParameter("e");
		String address = request.getParameter("a");
		
		System.out.println(id + " " + name + " " + email + " " + address);
		System.out.println(customer.getId() + " " + customer.getName() + " " + customer.getEmail() + " " + customer.getAddress() + "");
		
		if (customer.editCustomerAccount(id, name, email, address))
		{
			System.out.println("Customer Changed");	
			String s = "viewCustomerAccountDetails.jsp?id=" + id + "";
%>
			
		<jsp:forward page="<%= s %>" />

<%
	
		}
		else
		{
			String msg = customer.getMsg();
			out.println("Error Changing Phone Account");
			String s = "error.jsp?&url=editCustomerAccount.jsp&id=" + id + "";
			if (msg.length() != 0)
			{
				s += "&msg=" + msg;
			}
%>
		<jsp:forward page="<%= s %>" />
			
<%
		}

%>
